<template>
	<app-page>
		<wd-config-provider :theme="theme">
			<view class="container">
				<mp-html :content="html" />
			</view>
		</wd-config-provider>
	</app-page>
</template>

<script lang="ts">
	import { defineComponent, ref } from 'vue';

	import { onPageScroll, onLoad } from '@dcloudio/uni-app';
	import { protocol } from "./../api"


	export default defineComponent({
		name: '',
		components: {},
		setup(props, ctx) {
			// 日间light、夜间dark主题
			const theme = ref('light');
			const html = ref("")
			onLoad((params) => {
				if (params.title) {
					uni.setNavigationBarTitle({
						title: params.title
					})
					protocol[params.title]().then((res : any) => {
						html.value = res.xieyi;
					});
				}
				// protocol[]().then();
			})
			return {
				theme,
				html,
			};
		}
	});
</script>

<style lang="less" scoped>
	.container {
		padding: 24rpx;
	}
</style>